/**
 * 阅卷相关API
 */
import http from '../utils/http.js'

/**
 * 获取阅卷列表
 * @param {number} currentPage 当前页码
 * @param {number} pageSize 每页大小
 * @returns {Promise} 请求结果
 */
export function getMarkingList(currentPage = 1, pageSize = 5) {
  return http.get('/jsonrest/mobile/marking/MarkingTakeTask/0/findItemMarkList', {
    current_page: currentPage,
    page_size: pageSize
  })
}

/**
 * 获取科目信息
 * @param {number} itemId 考试项目ID
 * @param {number} type 考试类型
 * @returns {Promise} 请求结果
 */
export function getCourseInfos(itemId, type) {
  return http.get('/jsonrest/mobile/marking/MarkingTakeTask/0/getCourseInfos', {
    item_id: itemId,
    type: type
  })
}

/**
 * 获取科目进度信息
 * @param {number} itemId 考试项目ID
 * @param {number} courseId 科目ID
 * @returns {Promise} 请求结果
 */
export function getCoursePositionProgress(itemId, courseId) {
  return http.get('/jsonrest/mobile/marking/MarkingTakeTask/0/findCoursePositionProgress', {
    item_id: itemId,
    course_id: courseId
  })
}

/**
 * 获取题目列表
 * @param {number} itemId 考试项目ID
 * @param {number} type 考试类型
 * @returns {Promise} 请求结果
 */
export function getExamMarkPositionByTeach(itemId, type) {
  return http.get('/jsonrest/mobile/marking/MarkingTakeTask/0/getExamMarkPositionByTeach', {
    item_id: itemId,
    type: type
  })
}

/**
 * 获取题块各老师阅卷进度
 * @param {number} itemId 考试项目ID
 * @param {number} courseId 科目ID
 * @param {number} positionId 题块ID
 * @returns {Promise} 请求结果
 */
export function getPositionProgress(itemId, courseId, positionId) {
  return http.get('/jsonrest/mobile/marking/MarkingTakeTask/0/getPositionProgress', {
    item_id: itemId,
    course_id: courseId,
    position_id: positionId
  })
}

// 默认导出
export default {
  getMarkingList,
  getCourseInfos,
  getCoursePositionProgress,
  getExamMarkPositionByTeach,
  getPositionProgress
}

